package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.dto.NursingLevelPageQueryDto;
import com.zzyl.entity.NursingLevel;
import com.zzyl.vo.NursingLevelVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface NursingLevelMapper {

    @Select("select * from nursing_level where plan_id = #{id}")
    List<NursingLevel> getByPlanId(Long id);

    /**
     * 分页查询护理等级信息
     * */
    Page<NursingLevelVo> listByPage(NursingLevelPageQueryDto dto);

    /**
     * 插入护理等级信息
     * */

    void insert(NursingLevel nursingLever);

    @Select("select * from nursing_level where id = #{id}")
    NursingLevelVo getById(Long id);

    void update(NursingLevel nursingLever);

    @Delete("delete from nursing_level where id = #{id}")
    void deleteById(Long id);

    @Select("select * from nursing_level where status = 1")
    List<NursingLevelVo> findAll();
}
